<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen; http://apigen.org" />

	<title>Class Nette\Templates\TemplateHelpers</title>

	<link rel="stylesheet" href="resources/style.css?v=2011071314" type="text/css" media="all" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="search" href="opensearch.xml" type="application/opensearchdescription+xml" title="Nette Framework API documentation" />
	<script type="text/javascript" src="resources/combined.js"></script>
	<script type="text/javascript" src="allclasses.js"></script>
</head>

<body>
<div id="left">
	<a href="allclasses.html">All Classes</a>

	<h3>Namespaces</h3>
	<ul>
		<li><a href="namespace-none.html">none</a>
		</li>
		<li><a href="namespace-Nette.html">Nette</a>
		</li>
		<li><a href="namespace-Nette.Application.html">Nette\Application</a>
		</li>
		<li><a href="namespace-Nette.Caching.html">Nette\Caching</a>
		</li>
		<li><a href="namespace-Nette.Collections.html">Nette\Collections</a>
		</li>
		<li><a href="namespace-Nette.Config.html">Nette\Config</a>
		</li>
		<li><a href="namespace-Nette.Forms.html">Nette\Forms</a>
		</li>
		<li><a href="namespace-Nette.IO.html">Nette\IO</a>
		</li>
		<li><a href="namespace-Nette.Loaders.html">Nette\Loaders</a>
		</li>
		<li><a href="namespace-Nette.Mail.html">Nette\Mail</a>
		</li>
		<li><a href="namespace-Nette.Reflection.html">Nette\Reflection</a>
		</li>
		<li><a href="namespace-Nette.Security.html">Nette\Security</a>
		</li>
		<li class="active"><a href="namespace-Nette.Templates.html">Nette\Templates</a>
		</li>
		<li><a href="namespace-Nette.Web.html">Nette\Web</a>
		</li>
		<li><a href="namespace-PHP.html">PHP</a>
		</li>
	</ul>

	<hr />

	<h3>Classes</h3>

	<ul>
		<li><a href="Nette.Templates.BaseTemplate.html">BaseTemplate</a></li>
		<li><a href="Nette.Templates.CachingHelper.html">CachingHelper</a></li>
		<li><a href="Nette.Templates.CurlyBracketsMacros.html">CurlyBracketsMacros</a></li>
		<li><a href="Nette.Templates.LatteFilter.html">LatteFilter</a></li>
		<li><a href="Nette.Templates.LatteMacros.html">LatteMacros</a></li>
		<li><a href="Nette.Templates.SnippetHelper.html">SnippetHelper</a></li>
		<li><a href="Nette.Templates.Template.html">Template</a></li>
		<li><a href="Nette.Templates.TemplateCacheStorage.html">TemplateCacheStorage</a></li>
		<li><a href="Nette.Templates.TemplateFilters.html">TemplateFilters</a></li>
		<li class="active"><a href="Nette.Templates.TemplateHelpers.html">TemplateHelpers</a></li>
	</ul>

	<h3>Interfaces</h3>

	<ul>
		<li><a href="Nette.Templates.IFileTemplate.html">IFileTemplate</a></li>
		<li><a href="Nette.Templates.ITemplate.html">ITemplate</a></li>
	</ul>

</div>

<div id="right">
	<form action="http://www.google.com/cse" id="search" onsubmit="if(this.q.value.indexOf('more:')==-1)this.q.value+=' more:api'">
		<input type="hidden" name="cx" value="011549293477758430224:vxofa9ufnhc" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" class="text" /><input type="submit" value="Search" />
	</form>

<div id="navigation">
	<ul>
		<li><a href="overview.html" title="Summary of all namespaces">Overview</a></li>
		<li><a href="namespace-Nette.Templates.html" title="Summary of Nette\Templates">Namespace</a></li>
		<li class="active">Class</li>
		<li><a href="elements.html">Elements</a></li>
	</ul>
</div>

<div id="content">
	<div id="classSummary">
		<p>namespace <a href="namespace-Nette.Templates.html">Nette\Templates</a></p>

		<h1>Class TemplateHelpers</h1>

		<div class="classDescription">
		
<p>Standard template run-time helpers shipped with Nette Framework (<a
href="http://nette.org">http://nette.org</a>)</p>

		</div>




		<div class="classInfo">
			<b>Final Class</b><br />
				<b>Author:</b> David Grudl<br />
			<b>Located at</b> <a href="source-Templates.Filters.TemplateHelpers.php.html#20">/Templates/Filters/TemplateHelpers.php</a><br />
		</div>
	</div>


	<div id="methodSummary">
		<table class="summary">
		<caption>Method Summary</caption>
		<tr data-order="1 __construct" id="___construct">
			<td align="right" width="1%"><code class="nowrap">
				final public 
				
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___construct">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#28" title="go to source code"><b>__construct</b></a>(
			)</code>

			<div class="short">
				
<p>Static class – cannot be instantiated.</p>

			</div>

			<div class="detailed">
				
<p>Static class – cannot be instantiated.</p>






			</div>
			</td>
		</tr>
		<tr data-order="0 loader" id="_loader">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				callback
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_loader">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#38" title="go to source code"><b>loader</b></a>(
					string
					<var>$helper</var>
			)</code>

			<div class="short">
				
<p>Try to load the requested helper.</p>

			</div>

			<div class="detailed">
				
<p>Try to load the requested helper.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$helper</code> string helper name<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">callback </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeHtml" id="_escapeHtml">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeHtml">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#57" title="go to source code"><b>escapeHtml</b></a>(
					mixed
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside HTML template.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside HTML template.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> mixed UTF-8 encoding or 8-bit<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeHtmlComment" id="_escapeHtmlComment">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeHtmlComment">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#72" title="go to source code"><b>escapeHtmlComment</b></a>(
					mixed
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside HTML comments.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside HTML comments.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> mixed UTF-8 encoding or 8-bit<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeXML" id="_escapeXML">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeXML">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#85" title="go to source code"><b>escapeXML</b></a>(
					string
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside XML 1.0 template.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside XML 1.0 template.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> string UTF-8 encoding or 8-bit<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeCss" id="_escapeCss">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeCss">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#99" title="go to source code"><b>escapeCss</b></a>(
					string
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside CSS template.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside CSS template.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> string UTF-8 encoding or 8-bit<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeHtmlCss" id="_escapeHtmlCss">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeHtmlCss">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#112" title="go to source code"><b>escapeHtmlCss</b></a>(
					string
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside HTML style attribute.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside HTML style attribute.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> string UTF-8 encoding or 8-bit<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeJs" id="_escapeJs">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeJs">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#124" title="go to source code"><b>escapeJs</b></a>(
					mixed
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside JavaScript template.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside JavaScript template.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> mixed UTF-8 encoding<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 escapeHtmlJs" id="_escapeHtmlJs">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_escapeHtmlJs">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#139" title="go to source code"><b>escapeHtmlJs</b></a>(
					mixed
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Escapes string for use inside HTML JavaScript attribute.</p>

			</div>

			<div class="detailed">
				
<p>Escapes string for use inside HTML JavaScript attribute.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> mixed UTF-8 encoding<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 strip" id="_strip">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_strip">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#151" title="go to source code"><b>strip</b></a>(
					string
					<var>$s</var>
			)</code>

			<div class="short">
				
<p>Replaces all repeated white spaces with a single space.</p>

			</div>

			<div class="detailed">
				
<p>Replaces all repeated white spaces with a single space.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> string UTF-8 encoding or 8-bit<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 indent" id="_indent">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_indent">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#167" title="go to source code"><b>indent</b></a>(
					string
					<var>$s</var>, 
					int
					<var>$level</var> = <span class="php-num">1</span>, 
					string
					<var>$chars</var> = <span class="php-quote">'	'</span>
			)</code>

			<div class="short">
				
<p>Indents the HTML content from the left.</p>

			</div>

			<div class="detailed">
				
<p>Indents the HTML content from the left.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$s</code> string UTF-8 encoding or 8-bit<br />
						<code>$level</code> int <br />
						<code>$chars</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 date" id="_date">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_date">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#186" title="go to source code"><b>date</b></a>(
					string|int|<a href="DateTime.html">DateTime</a>
					<var>$time</var>, 
					string
					<var>$format</var> = <span class="php-quote">'%x'</span>
			)</code>

			<div class="short">
				
<p>Date/time formatting.</p>

			</div>

			<div class="detailed">
				
<p>Date/time formatting.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$time</code> string|int|<a href="DateTime.html">DateTime</a> <br />
						<code>$format</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 bytes" id="_bytes">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_bytes">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#206" title="go to source code"><b>bytes</b></a>(
					int
					<var>$bytes</var>, 
					int
					<var>$precision</var> = <span class="php-num">2</span>
			)</code>

			<div class="short">
				
<p>Converts to human readable file size.</p>

			</div>

			<div class="detailed">
				
<p>Converts to human readable file size.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$bytes</code> int <br />
						<code>$precision</code> int <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 length" id="_length">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				int
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_length">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#225" title="go to source code"><b>length</b></a>(
					mixed
					<var>$var</var>
			)</code>

			<div class="short">
				
<p>Returns array of string length.</p>

			</div>

			<div class="detailed">
				
<p>Returns array of string length.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$var</code> mixed <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">int </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 replace" id="_replace">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_replace">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#237" title="go to source code"><b>replace</b></a>(
					string
					<var>$subject</var>, 
					string
					<var>$search</var>, 
					string
					<var>$replacement</var> = <span class="php-quote">''</span>
			)</code>

			<div class="short">
				
<p>Performs a search and replace.</p>

			</div>

			<div class="detailed">
				
<p>Performs a search and replace.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$subject</code> string <br />
						<code>$search</code> string <br />
						<code>$replacement</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 replaceRe" id="_replaceRe">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_replaceRe">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#251" title="go to source code"><b>replaceRe</b></a>(
					string
					<var>$subject</var>, 
					string
					<var>$pattern</var>, 
					string
					<var>$replacement</var> = <span class="php-quote">''</span>
			)</code>

			<div class="short">
				
<p>Performs a regular expression search and replace.</p>

			</div>

			<div class="detailed">
				
<p>Performs a regular expression search and replace.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$subject</code> string <br />
						<code>$pattern</code> string <br />
						<code>$replacement</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 null" id="_null">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_null">#</a>
			<code class="nowrap">
				<a href="source-Templates.Filters.TemplateHelpers.php.html#265" title="go to source code"><b>null</b></a>(
					mixed
					<var>$value</var>
			)</code>

			<div class="short">
				
<p>/dev/null.</p>

			</div>

			<div class="detailed">
				
<p>/dev/null.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$value</code> mixed <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>

		</table>
	</div>









</div>

	<div id="footer">
		Nette Framework API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
</body>
</html>
